//判断是移动还是pc
function browserRedirect() {
    var sUserAgent = navigator.userAgent.toLowerCase();
    var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
    var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
    var bIsMidp = sUserAgent.match(/midp/i) == "midp";
    var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
    var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
    var bIsAndroid = sUserAgent.match(/android/i) == "android";
    var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
    var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
    if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
        console.log("移动端")
		$('.header').css('height',client().width/1.5)
		$('.footer').css('height',client().width/1.5)
		$('.succdloc_t_r h3').hide()
		$('.succdloc_t_r p').hide()
		alert('最好用电脑访问')
    } else {
        console.log("pc")
        $('.Mobile_terminal').hide()
		$('.header').css('height',client().height+25)
		$('.footer').css('height',client().width/1.5)
    }
}


$(document).ready(function(){
	
	browserRedirect();
	
	

	
	//顶部插件
	$(".movie").hover3d({
		selector: ".movie__card",
		shine: true,
		sensitivity: 100,
	});
	
	//播放器
	var myVideo=document.getElementById("yinyue"); 
	$('.bofang').attr('class','bofang bol2')
	$('.bofang').click(function(){
		if (myVideo.paused) {
			$('.bofang').attr('class','bofang bol2')
			myVideo.play(); 
		}else{ 
			myVideo.pause();
			$('.bofang').attr('class','bofang bol1')
		}
	})
	$('.music').hover(function(){
		$(this).stop().animate({"left":0},200)
	},function(){
		$(this).stop().animate({"left":-62},200)
	})
	
	//六角 数据
	$.ajax({
		type:"GET",
		url:'mafei.json',
		dataType:"JSON",
		success:function(data){
			var html=''
			$.each(data.tabico,function(i){
				html+='<li class="hex" id="'+data.tabico[i].id+'">'
				html+='<a class="hexIn" href="'+data.tabico[i].url+'" target="_blank">'
				html+='<img src="'+data.tabico[i].img+'"/>'
				html+='<h1>'+data.tabico[i].title+'</h1>'
				html+='<p>'+data.tabico[i].content+'</p>'
				html+='</a>'
				html+='</li>'
			})
			$('.hexGrid').empty().append(html)
			$('.succdloc_t_r h2').text(data.basic.name)
			$('.succdloc_t_r h3 a').text(data.basic.urlsname)
			$('.succdloc_t_r h3 a').attr('href',data.basic.urls)
			$('.succdloc_t_r p').text(data.basic.explain)
			
			
		}	
	})
	





	//置顶
	$(window).scroll(function () {
        if ($(window).scrollTop() >= 900) {
            $('.returntop').fadeIn(300);
        } else {
            $('.returntop').fadeOut(300);
        }
    });
    $('.returntop').click(function () {
        $('html,body').animate({scrollTop: '0px'}, 800);
    });


	


	
});